const Mock = require("mockjs")

Mock.setup({
    timeout: 500
});

// 配置返回数据 第一个参数是要匹配的url(可以使用正则匹配)，第二个参数是要返回的数据
Mock.mock('/http/user/login',"get", {
    id: '@increment',
    name: '@cname',
    password: '@password',
    'sex|0-1': 0,
    number: '@integer(1,100)',
    url: '@url',
    date: '@date',
    datetime: '@datetime',
    time: '@datetime(hh:mm:ss)',
    address: '@province @city @county',
    phone: '13520073575',
});

Mock.mock('/http/list',"get", [
    {
        id: '@increment',
        name: '@cname',
        img: Mock.Random.dataImage('400x300', Mock.mock({'regexp': /\w{4}/}).regexp)
    },
    {
        id: '@increment',
        name: '@cname',
        img: Mock.Random.dataImage('400x300', Mock.mock({'regexp': /\w{4}/}).regexp)
    },
    {
        id: '@increment',
        name: '@cname',
        img: Mock.Random.dataImage('400x300', Mock.mock({'regexp': /\w{4}/}).regexp)
    }
]);